package br.com.sca.util;

import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.SQLException;

public class AcessoBD {

    Connection con;

    public Connection getConexao() throws SQLException {
        try {
            Class.forName("org.postgresql.Driver");
            con = DriverManager.getConnection("jdbc:postgresql://localhost:5432/sca?user=postgres&password=1234");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        return con;
    }

    public void desconectar() {
        try {
            con.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
